package com.zhuangjie.shop.controller;


import com.zhaungjie.base.conduit.R;
import com.zhuangjie.shop.entity.DishFlavor;
import com.zhuangjie.shop.service.DishFlavorService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 菜品口味表 前端控制器
 * </p>
 *
 * @author zhuangjie
 * @since 2023-09-24
 */
@RestController
@RequestMapping("/dish-flavor")
public class DishFlavorController {
    @Autowired
    private DishFlavorService dishFlavorService;

    /**
     * 查询店铺菜品风味
     *
     * @param keyword 搜索关键字
     * @param max     返回的最大条数
     * @return {@link R}
     */
    @GetMapping("selectShopDishFlavor")
    @ApiOperation("搜索店铺口味")
    public R selectShopDishFlavor(@RequestParam("keyword") String keyword,@RequestParam("max") Integer max ) {
        List<DishFlavor> dishFlavorList =  dishFlavorService.selectShopDishFlavor(keyword,max);
        return R.ok().data(dishFlavorList);
    }

}

